//
//  TBKConfig.swift
//  TBKApp
//
//  Created by ryan on 2019/4/26.
//  Copyright © 2019 ryan. All rights reserved.
//

import UIKit
import AdSupport

enum FGTopicType: Int {
    case TopicSelection = 0
    
    case TopicHousehold = 1
    
    case TopicDigital = 2
}

//MARK: - Save_Key

let FG_Appshop_Id = "1467881951"

/// 第一次启动
let FG_Key_FirstLaunch = "TBK_Key_FirstLaunch"
/// 搜索存储key
let FG_Key_Search = "TBK_Key_Search"

/// html
let FG_HTML_Bridge = "bridge"

/// 微信支付scheme
let FG_WXPay_Scheme = "gat.api.51app.cn://"


//MARK: - Screen

/// 屏幕宽
let KScreenWidth = UIScreen.main.bounds.size.width

/// 屏幕高
let KScreenHeight = UIScreen.main.bounds.size.height

/// 屏幕size
let KScreenSize = UIScreen.main.bounds.size

//let baseCellItemHeight : CGFloat = CGFloat(((KScreenWidth - 33)/2) * (295.0/171.0) + 9)
let baseCellItemHeight : CGFloat = CGFloat(((KScreenWidth - 18)/2)+121+6)

/// iPhone 5
let KIsIphone5 = KScreenHeight == 568 ? true : false

/// iPhone 6
let KIsIphone6 = KScreenHeight == 667 ? true : false

/// iphone 6P
let KIsIphonePlus = KScreenHeight == 736 ? true : false

/// iphone x xr xsmax
let KIsIphoneX = KScreenHeight == 812 || KScreenHeight == 896 ? true : false

/// navi 高度
let KSafeAreaNavHeight : CGFloat = KIsIphoneX ? 88.0 : 64.0

let KSafeAreaStatusBarHeight : CGFloat = KIsIphoneX ? 44.0 : 20.0

let KSafeAreaBottomHeight : CGFloat = KIsIphoneX ? 34.0 : 0.0

let KBottomTabbarHeight : CGFloat = 49.0


/// 无导航栏有TabBar
let KSafeAreaFrameWithTabBar = CGRect (x: 0.0, y: 0.0, width: KScreenWidth, height: KScreenHeight-KBottomTabbarHeight-KSafeAreaBottomHeight)

/// 无导航栏和TabBar
let KSafeAreaFrame = CGRect (x: 0.0, y: 0.0, width: KScreenWidth, height: KScreenHeight-KSafeAreaBottomHeight)


/// TabBar_frame
let KTabBarBottomFrame = CGRect (x: 0.0, y: KScreenHeight-KSafeAreaBottomHeight-KBottomTabbarHeight, width: KScreenWidth, height: KBottomTabbarHeight)

//let ParamHandle.isNewTDDUrl() = UserDefaults.standard.bool(forKey: "isNewTDD")

//MARK: - Color
/// bar color
let UC_Default_Bar = UIColor.white
/// 浅灰色
let UC_LightGray = UIColor.hex(hexString: "#666666")
/// 主题色
let UC_Subject = UIColor.hex(hexString: "#BF3627")
/// 订单灰
let UC_OrderGray = UIColor.hex(hexString: "#F2F2F2")
/// 价格红
let UC_PriceRed = UIColor.hex(hexString: "#FF2B2B")

//MARK: - Font

/// 厚字体
let PingFang_Bold = "PingFangSC-Semibold"
/// 常规字体
let PingFang_Regular = "PingFang-SC-Regular"


//MARK: - APPKEY
/// 拉起小程序
let wx_mineUserName = "gh_9cb118bcc244"

/// 友盟App key
let UM_AppKey = "5cdb7646570df3fff1000fb1"

/// wechat_key
let wx_AppKey = "wxec9736d99bae6e61"

/// wechat_secret
let wx_AppSecret = "0559bc1f34796e9ff70df566f7fe4c60"

/// QQ_AppID
//let qq_AppId = "1107904317"
/// QQ_AppSecret
//let qq_secret = "8DtyULof7n3tz7mB"

///高德地图
let GD_AppKey = "d6834c96bf8798d9183c49ec5b08d2d9"

/// QQ_AppID_test
let qq_AppId = "1109990037"
/// QQ_AppSecret_test
let qq_secret = "rgui8zNTogAQU8Jh"

let Talking_AppId = "2C1CF88CE92F4F5382E698FD193F4FC9"

//MARK: Version

let tbkInfoDictionary = Bundle.main.infoDictionary!
/// 程序名
let FG_version_displayName = tbkInfoDictionary["CFBundleDisplayName"]
/// 主程序版本号
let FG_version_major = tbkInfoDictionary["CFBundleShortVersionString"]
/// 版本号（内部标示）
let FG_version_minor = tbkInfoDictionary["CFBundleVersion"]
/// 版本字符串
let FG_version_main = FG_version_major as! String

/// idfa
let FGIdfaString = ASIdentifierManager.shared().advertisingIdentifier.uuidString


/// 全局打印
///
/// - Parameters:
///   - message: 打印内容
///   - file: 文件名
///   - lineNum: 行数
func DDLog<T>(message : T, file : String = #file, funcName : String = #function, lineNum : Int = #line) {
    
    let fileName = (file as NSString).lastPathComponent
    
    print("[文件名 : \(fileName)]\n[行数 : \(lineNum)]\n[打印内容 : \(message)]")
}
